/**
 * Author: Dmitry Ustimov
 * Date: 6/1/13
 * Time: 10:08 PM
 */

package com.gmail.dmitryustimov.ms.java7.chain_of_responsibility.classic.work.demo.handlers1_100_request1;

public class Demo {

    private static final int NUM_HANDLERS = 100;

    public static void main(String[] args) {

        Handler h1 = new CocreteHandler1("CocreteHandler1", 10);
        Handler beforeNext = h1;

        for (int i = 1; i < NUM_HANDLERS; i++) {
            Handler next = new CocreteHandler1("CocreteHandler" + (i + 1), 10);
            beforeNext.setNext(next);
            beforeNext = next;
        }

        Request request1 = new Request1("Request1", 5);

        h1.handleChain(request1);
    }
}
